<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
	<TITLE></TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 2.0  (Linux)">
	<META NAME="AUTHOR" CONTENT="kejin">
	<META NAME="CREATED" CONTENT="20061120;17150100">
	<META NAME="CHANGEDBY" CONTENT="kejin">
	<META NAME="CHANGED" CONTENT="20070513;12105000">
	<STYLE TYPE="text/css">
	<!--
		@page { size: 8.5in 11in; margin: 0.79in }
		P { margin-bottom: 0.08in }
		H2 { color: #000000 }
		H3 { color: #000000 }
		PRE { color: #000000 }
	-->
	</STYLE>
</HEAD>
<BODY LANG="en-US" DIR="LTR">
<H2>PocoCapsule/C++ example: OASIS-OpenCSA Bigbank 
</H2>
<P>Copyright(c) 2006 by <A HREF="http://www.pocomatic.com/">Pocomatic
Software</A>. All rights reserved. 
</P>
<P>The <A HREF="http://www.oasis-opencsa.org/">OASIS-OpenCSA</A>
(Open Composite Services Architecture, formerly known as OpenSOA's
Service Component Architecture) is a component model for building
applications and systems in Service-Oriented Architecture (SOA). 
</P>
<P>This <I>BigBank </I>presented here is a well known OASIS-OpenCSA
example that is highlighted in official OASIS-OpenCSA <A HREF="http://www.osoa.org/download/attachments/28/SCA_BuildingYourFirstApplication_V09.pdf?version=1">documents</A>
as well as the prove-of-concept <A HREF="http://cwiki.apache.org/confluence/display/TUSCANY/SCA+Native">prototype
implementation</A>. However, due to its prototype nature and
technology limitation, the prototype implementation for C++
applications is intrusive, and business logic component
implementations have to be specifically written for the OpenCSA
framework (therefore, a technology lock-in) and also tightly coupled
with the container's runtime environment. In contrast, the industry
strengthen PocoCapsule/C++ is the first and the only non-intrusive
OpenCSA container for C++ applications that supports plain old C++
object as OASIS-OpenCSA components. 
</P>
<P>This example consists of one OpenCSA composite that exports one
web service (defined by <A HREF="AccountService.wsdl">AccountService.wsdl</A>),
uses one external service (defined by <A HREF="StockQuoteWebService.wsdl">StockQuoteWebService.wsdl</A>),
and contains the following three components:</P>
<UL>
	<LI><P><FONT SIZE=2 STYLE="font-size: 11pt">AccountServiceComponent:
	T<FONT SIZE=2 STYLE="font-size: 9pt">his component will be exported
	as a web service, therefore, its implementation class
	(AccountServiceComponentImpl) is extended from a SOAP skeleton
	(AccountServiesSOAPImpl) generated from WSDL.</FONT></FONT></P>
	<LI><P><FONT SIZE=2 STYLE="font-size: 11pt">AccountDataServiceComponent:
	<FONT SIZE=2 STYLE="font-size: 9pt">This component is only referred
	within the composite and will not be exported as web service.
	Therefore, its implementation does not subclass from any virtual
	interface class.</FONT></FONT></P>
	<LI><P><FONT SIZE=2 STYLE="font-size: 11pt">StockQuoteServiceComponent:
	<FONT SIZE=2 STYLE="font-size: 9pt">Similar, this component is also
	only referred within the composite and therefore does not subclass
	from any virtual interface class either.</FONT></FONT></P>
</UL>
<P STYLE="margin-bottom: 0in">Above components are implemented in
<A HREF="Components.h">Components.h</A> and <A HREF="Components.C">Components.C</A>
as plain old C++ objects (POCO). They are wired up by PocoCapsule
Container through C++ setter operations of their POCO classes. The
wiring assembly description schema/model used in this example is
defined in <A HREF="http://www.osoa.org/download/attachments/35/SCA_AssemblyModel_V096.pdf?version=1">OpenCSA's
assembly model 0.96</A>. PocoCapsule also comes with an equivalent
but non-OpenCSA version of bigbank example in
<A HREF="../bigbank-ws/README.html">${POCOCAPSULE_DIR}/examples/web-services/bigbank-ws</A>
directory, that uses a POCO-WebServices assembly model. 
</P>
<H3><A HREF="bigbank-ocsa.jpg"><IMG SRC="bigbank-ocsa.jpg" NAME="BIGBANK-OCSA.JPG" ALIGN=LEFT WIDTH=714 HEIGHT=477 BORDER=0><BR CLEAR=LEFT></A>Source
Files</H3>
<P><A HREF="server.C">server.C:</A> This is a simple container, used
to setup and assemble the OASIS-OpenCSA composite. It is notable that
this container itself neither contains code, nor links with
application specific bean implementations.</P>
<P><A HREF="AccountService.wsdl">AccountService.wsdl</A>: The
definition of the web service provided by the bigbank server. 
</P>
<P><A HREF="StockQuoteWebService.wsdl">StockQuoteWebService.wsdl</A>:
The definition of the web service provided by www.webserviceX.NET.
This web service is used by the StockQuoteServiceComponent of the
bigbank composite. 
</P>
<P><A HREF="Components.h">Components.h</A> and <A HREF="Components.C">Components.C</A>:
These files provide implementations (in form of plain old C++ object
classes) of the three components. 
</P>
<P><A HREF="server.config">server.config</A>: The Pococapsule Web
Service application descriptor that describes this example's Web
Service setup.</P>
<P><A HREF="bigbank.account.composite">bigbank.account.composite</A>:
The OASIS-OpenCSA assembly descriptor that describes the wiring
(connections) of components/ports in the OASIS-OpenCSA composite.</P>
<P><A HREF="setup.xml">setup.xml</A>: The main setup descriptors that
first loads the needed library (the one contains component
implementation classes) and then instantiates the web service engine
and wires (connects) the OASIS-OpenCSA composite by importing the
<A HREF="server.config">server.config</A> and
<A HREF="bigbank.account.composite">bigbank.account.composite</A>. 
</P>
<P><A HREF="client.C">client.C</A>: The client application. 
</P>
<H3>Building this example</H3>
<P>To build this example, the environment variable POCOCAPSULE_DIR
should point to the PocoCapsule/C++ installed directory. Also, this
example assumes the <A HREF="http://www.systinet.com/products/ssc/overview">Systinet
server for C++</A> is installed and its runtime and development
environment (such as WASPC_HOME environment variable pointing to its
installation directory) are set properly according to its
specification. 
</P>
<P STYLE="font-weight: medium">Once the environment is set and
required Systinet server for C++ is installed and configured
accordingly, this example can be built by simply invoking gmake/make
on linux/unix or nmake on windows. 
</P>
<H3>Running this example</H3>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">Before
starting the server, make sure the LD_LIBRARY_PATH (on linux and
solaris) or the PATH (on windows) environment variable is set
correctly to include the ${POCOCAPSULE_DIR}/lib directory and <FONT FACE="Times New Roman">the
${WASPC_HOME}/lib directory</FONT>.</FONT></P>
<P><FONT FACE="Symbol">&middot; </FONT><FONT FACE="Times New Roman">start
the bigbank AccountService server as: </FONT>
</P>
<PRE STYLE="margin-left: 0.79in"><FONT FACE="Courier 10 Pitch"><FONT SIZE=2><B>prompt&gt;</B> server</FONT></FONT></PRE><P STYLE="margin-bottom: 0in">
<FONT FACE="Times New Roman">The, start the client:</FONT></P>
<PRE STYLE="margin-left: 0.79in"><FONT FACE="Courier 10 Pitch"><FONT SIZE=2><B>prompt&gt;</B> client [server-URL]</FONT></FONT></PRE><P STYLE="margin-bottom: 0in">
<FONT FACE="Times New Roman">Here, the server URL is (optional, if
client is on localhost): http://&lt;server-address&gt;:6070/AccountService.</FONT></P>
<P STYLE="margin-bottom: 0.2in"><FONT FACE="Times New Roman">On
receiving client request, the server will contact the Web Serivces
site www.webserviceX.net and print out the following messages:</FONT></P>
<PRE STYLE="margin-left: 0.79in"><FONT FACE="Courier 10 Pitch">GetQuote on www.webserviceX.net, pls wait ...</FONT>
<FONT FACE="Courier 10 Pitch">Stock IBM last price is : 95.03</FONT>
<FONT FACE="Courier 10 Pitch">Currency is : EURO</FONT></PRE><P STYLE="margin-bottom: 0.2in">
<FONT FACE="DejaVu Sans, sans-serif"><FONT SIZE=3>On client side, a
account report will be printed out after receiving stock quote result
from server:</FONT></FONT></P>
<PRE STYLE="margin-left: 0.79in"><FONT FACE="Courier 10 Pitch">Account Report</FONT>
<FONT FACE="Courier 10 Pitch">==============</FONT>
<FONT FACE="Courier 10 Pitch">Stock Account peter2006_STA12345</FONT>
<FONT FACE="Courier 10 Pitch">Stock Symbol : IBM</FONT>
<FONT FACE="Courier 10 Pitch">Holding : 1000</FONT>
<FONT FACE="Courier 10 Pitch">Value : 76024.00</FONT>

<FONT FACE="Courier 10 Pitch">Checking Account peter2006_CHA12345</FONT>
<FONT FACE="Courier 10 Pitch">Balance : 1200.00</FONT>

<FONT FACE="Courier 10 Pitch">Savings Account peter2006_SAA12345</FONT>
<FONT FACE="Courier 10 Pitch">Balance : 2000.00</FONT></PRE><P>
<A HREF="../../README.html">Back to the root page</A></P>
</BODY>
</HTML>
